package com.niiwoo.civet.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class MobileChangeRecordEnum {

    @AllArgsConstructor
    @Getter
    public enum ChangeTypeEnum {
        REAL_NAME_CHANGE((byte) 1, "无法接收短信：用户实名信息验证"),
        SMS_CHANGE((byte) 2, "可以接收短信：短信验证");

        private Byte value;
        private String desc;

        public static ChangeTypeEnum of(byte value) {
            for (ChangeTypeEnum t : values()) {
                if (t.value == value) {
                    return t;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum ChangePhoneNumberEnum{
        NOT_REAL_NAME((byte) 0, "未实名"),
        PASS_CERTIFIED_NO_ACCOUNT_OPENING((byte) 1, "已实名未存管"),
        OPEN_AN_ACCOUNT((byte) 2, "已开通存管");

        private Byte value;
        private String desc;

        public static ChangePhoneNumberEnum of(byte value) {
            for (ChangePhoneNumberEnum t : values()) {
                if (t.value == value) {
                    return t;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum ChangeResultEnum {
        CAN_CHANGE((byte) 0, "可以更换手机"),
        OVERDUE_LOAN((byte) 1, "逾期未结清"),
        LIMIT_3_MONTHS((byte) 2, "更换限制3个月"),
        CHECKING((byte) 3, "审核中不能更换");

        private Byte value;
        private String desc;

        public static ChangeResultEnum of(byte value) {
            for (ChangeResultEnum t : values()) {
                if (t.value == value) {
                    return t;
                }
            }
            return null;
        }
    }

}
